import java.util.Scanner;

public class Main4 {

	public static void main(String[] args) throws Exception {
		Scanner scanner = new Scanner(System.in);
		while (scanner.hasNext()) {
			if (scanner.next().equals("new")) {
				try {
					Student stu = new Student();
					stu.setName(scanner.next());
					int score = scanner.nextInt();
					stu.setScore(score);
					stu.addScore(score);
					System.out.println(stu.toString());
				} catch (IllegalNameException e) {
					System.out.println(e);
					break;
				} catch (IllegalScoreException e) {
					System.out.println(e);
				}
			}
		}
		scanner.close();
		System.out.println("scanner closed");
	}

}

class IllegalScoreException extends Exception {
	public IllegalScoreException(String msg) {
		super(msg);
	}
}

class IllegalNameException extends RuntimeException {
	public IllegalNameException(String msg) {
		super(msg);
	}
}

class Student {
	private String name;
	private int score;

	public String getName() {
		return name;
	}

	public void setName(String name) throws IllegalNameException {
		this.name = name;
		char charName = name.charAt(0);
		if (charName >= '0' && charName <= '9') {
			throw new IllegalNameException("the first char of name must not be digit, name=" + name);
		}
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	@Override
	public String toString() {
		return "Student [name=" + name + ", score=" + score + "]";
	}

	public int addScore(int score) throws IllegalScoreException {
		if (score < 0 || score > 100) {
			throw new IllegalScoreException("score out of range, score=" + score);
		}
		return score;
	}
}
